<?php 
    include "database.php";
    //Za delovanje seje na vseh nivojih
    session_set_cookie_params(0,"/");
    session_start();

    if(!isset($_SESSION['username'])) {
        header("Location: login.php");
    }
    
    $admin = checkAdmin($_SESSION['id']);
    
    
    $usr_id = $_SESSION['id'];
    $queryProject = "SELECT current_project FROM user WHERE id = '$usr_id'";
    $resProject = executeQuery($queryProject);
    $row = mysql_fetch_array($resProject);
    $curr_proj = $row["current_project"];
    
    $show = 1;
    $queryCheck = "SELECT * FROM story WHERE story_finished < 1 and project_id = '$curr_proj'";
    $queryCheckResult = executeQuery($queryCheck);
                                            
        if (mysql_num_rows($queryCheckResult) < 1){
            $show = 0;
        }
   
   $queryMaster = "SELECT scrum_master, product_owner FROM project WHERE project_id = '$curr_proj';";
   $resultMaster = executeQuery($queryMaster);
   $rowMaster = mysql_fetch_array($resultMaster);
   $projectMaster = $rowMaster["scrum_master"];
   $productOwner = $rowMaster["product_owner"];
   
   
   
   $sprintInProgress = getCurrentSprint($curr_proj);
   //echo "$sprintInProgress ";
   $queryCurrentSprintID = "UPDATE project SET current_sprint='$sprintInProgress' WHERE project_id='$curr_proj' ";
   executeQuery($queryCurrentSprintID);
   
   $queryCurrentSprintNumber = "SELECT sprint_number FROM sprint WHERE sprint_id='$sprintInProgress'";
   $currentSprintNumberResult = executeQuery($queryCurrentSprintNumber);
   while ($row = mysql_fetch_array($currentSprintNumberResult)) {
   		$currentSprintNumber = $row[0];
   		//echo "$currentSprintNumber";
   }
   $notSet="/";
?>

<!DOCTYPE html>

<html>
	<head>
	    <meta charset="utf-8">
		
		<!-- Font weight: light (300) & semibold (600) -->
		<link href='http://fonts.googleapis.com/css?family=Open+Sans:600,300' rel='stylesheet' type='text/css'>
		<link rel="stylesheet" href="css/default.css"/>
		<link rel="stylesheet" href="css/tabs.css"/>
		<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
		
		<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui-1.10.2.custom.min.js"></script>
		<script type="text/javascript" src="js/actions.js"></script>
		
		<title>Scrum | Product Backlog</title>		
	</head>
	
	<body>
	
		<span id="username"><?php echo $_SESSION['username']  ?></span>
		<span id="separator">|</span>
		<span id="role"><a href="edit_profile.php">edit</a></span>
		
		<h1>Scrum</h1>
		
		<menu>
			<li><a href="control_panel.php">control<span>Panel</span></a>&nbsp;&nbsp;|&nbsp;</li>
			<li><a href="project_wall.php">project<span>Wall</span></a>&nbsp;&nbsp;|&nbsp;</li>
			<li><a class="active" href="product_backlog.php">product<span>Backlog</span></a>&nbsp;&nbsp;|&nbsp;</li>
			<li><a href="sprint_backlog.php">sprint<span>Backlog</span></a>&nbsp;&nbsp;|&nbsp;</li>
			<li><a href="my_tasks.php">my<span>Tasks</span></a>&nbsp;&nbsp;|&nbsp;</li>
			<li><a href="progress_report.php">progress<span>Reports</span></a>&nbsp;&nbsp;|&nbsp;</li>
			<li><a href="./php/logout.php">logout</a></li>
		</menu>
		
		<section>
                        <?php if ($curr_proj < 1)
                            print "<div class=\"story no_stories\">
                                        <p>No projects selected!</p>
                                   </div>";
                        else{ ?>
		
			<ul id="tabs">
				<li><h2><a id="u_stories" href="#" name="unfinished_stories">unfinished<span>Stories</span></a></h2></li>
				<li><h2><a href="#" name="finished_stories">finished<span>Stories</span></a></h2></li>
                                <?php if ($usr_id == $projectMaster || $usr_id == $productOwner){ ?>
				<li><h2><a href="#" name="new_story">new<span>Story</span></a></h2></li>
                                <?php } ?>
                <?php  if($projectMaster == $usr_id){ ?>
                <li><h2><a href="#" name="manage_sprints">manage<span>Sprints</span></a></h2></li>    
                <?php } ?>            
           </ul>
			
			<div id="tab_content">
                            <?php
                                if ($show < 1)
                                    print "<div class=\"story no_stories\">
                                                <p>No unfinished stories in this project</p>
                                           </div>";
                            ?>
				<!--====================-->
				<!-- Unfinished stories -->
				<!--====================-->
			
				<div id="unfinished_stories" class="stories_container">			
                                       
                                        <?php                                 
                                        
                                            $querySprint = "SELECT current_sprint FROM project WHERE project_id = '$curr_proj'";
                                            $querySprintResult = executeQuery($querySprint);    
                                            
                                            if (mysql_num_rows($querySprintResult) != 0){
                                                $row = mysql_fetch_array($querySprintResult);
                                                $current_sprint = $row["current_sprint"];
                                            }
                                            
                                            if (isset($current_sprint) && $current_sprint > 0){                                               

                                                $query = "SELECT * FROM story WHERE story_finished < 1 and story_sprint > 0 and project_id = '$curr_proj'"; 
                                                $queryResult = executeQuery($query);
                                                
                                                if (mysql_num_rows($queryResult) != 0){
                                                    echo "<h3>User stories for Sprint $currentSprintNumber</h3>";

                                                    while ($row = mysql_fetch_array($queryResult)) {
                                                        $story_id       = $row["story_id"];
                                                        $story_title    = $row["story_title"];
                                                        $story_text     = $row["story_text"];
                                                        $story_test     = nl2br($row["story_test"]);
                                                        $story_value    = $row["story_value"];    
                                                        $story_time     = $row["story_time"];
                                                        $story_priority = $row["story_priority"];
                                                        $story_notes    = $row["story_notes"];
                                                        $boolChecked    = 1;
                                                        $boolTaskCount  = 0;

                                                        $prior = "priority not set";
                                                        if ($story_priority == 1)
                                                            $prior = "must have";
                                                        else if ($story_priority == 2)
                                                            $prior = "should have";
                                                        else if ($story_priority == 3)
                                                            $prior = "could have";
                                                        else if ($story_priority == 4)
                                                            $prior = "won't have this time";

                                                        if (!isset($story_time))
                                                            $story_time = $notSet;
                                                        else
                                                            $story_time = strval($story_time)." pt";

                                                        print "<div class=\"story\">                                                                   
                                                                    <input type=\"hidden\" name=\"story_id\" value=\" $story_id \" />
                                                                    <div class=\"header\">
                                                                        <span class=\"values\">$prior | business value: $story_value | time estimate: $story_time</span>                            
                                                                        <h5>$story_title</h5><br/>
                                                                        <a href=\"#\" class=\"notes_story\">notes</a>
                                                                    </div>";

                                                                    
                                                                    print "<p>$story_text</p>";
                                                                    if ($story_text != "")
                                                                        print "--";
                                                                    print "<p class=\"test_list\">$story_test</p>";
                                                                    
                                                                    if ($usr_id == $productOwner){
                                                                            
                                                                        $queryCheckTasks = "SELECT * FROM task WHERE story_id = '$story_id'"; 
                                                                        $queryCheckTasksResult = executeQuery($queryCheckTasks);
                                                                        
                                                                        if (mysql_num_rows($queryCheckTasksResult) != 0){    
                                                                            $boolTaskCount = 1;
                                                                            print "<table class=\"tasks_table\">";
                                                                            print "<thead>
                                                                                   <td>tasks</td><td>status</td>
                                                                               </thead>";
                                                                            while ($rowCheckTasks = mysql_fetch_array($queryCheckTasksResult)) {
                                                                                $task_status = $rowCheckTasks["task_status"];
                                                                                $task_title  = $rowCheckTasks["task_title"];
                                                                                $status_text  = "";
                                                                                
                                                                                if($task_status < 2)
                                                                                    $status_text = "Not complete";
                                                                                else
                                                                                    $status_text = "Complete";
                                                                                
                                                                                print "<tr>
                                                                                               <td>$task_title</td><td>$status_text</td>
                                                                                       </tr>";
                                                                                        
                                                                                if ($task_status < 2){
                                                                                   $boolChecked = 0;
                                                                                    break;
                                                                                }
                                                                            }
                                                                            print "</table>";
                                                                        }
                                                                    }
                                                                    
                                                                    if ($story_notes != "")
                                                                        print "<span class=\"comment_separator\">--</span>
                                                                        <!--<p class=\"comments\">$story_notes</p>-->";   
                                                                    
                                                                    
                                                                    if ($usr_id == $productOwner){                                                                 
                                                                        
                                                                        /*
                                                                        $queryCheckTasks = "SELECT * FROM task WHERE story_id = '$story_id'"; 
                                                                        $queryCheckTasksResult = executeQuery($queryCheckTasks);
                                                                        $boolChecked = 1;*/
                                                                        
                                                                        if (mysql_num_rows($queryCheckTasksResult) != 0){                      
                                                                            
                                                                            /*while ($rowCheckTasks = mysql_fetch_array($queryCheckTasksResult)) {
                                                                                $story_status = $rowCheckTasks["task_status"];
                                                                                if ($story_status < 2){
                                                                                   $boolChecked = 0;
                                                                                    break;
                                                                                }
                                                                            }*/
                                                                           if ($boolChecked == 1){
                                                                               print  "<!-- Visible only to product owner -->
                                                                                <div class=\"story_confirming\">
                                                                                        <button type=\"button\" class=\"confirm_story_submit\">confirm</button>
                                                                                        <button type=\"button\" class=\"reject_story_submit\">reject</button>
                                                                                </div>";
                                                                           }else{
                                                                               print  "<!-- Visible only to product owner -->
                                                                                <div class=\"story_confirming\">                                                                                     
                                                                                        <button type=\"button\" class=\"reject_story_submit\">reject</button>
                                                                                </div>";
                                                                           }
                                                                        }else{
                                                                            print  "<!-- Visible only to product owner -->
                                                                                <div class=\"story_confirming\">                               
                                                                                        <button type=\"button\" class=\"reject_story_submit\">reject</button>
                                                                                </div>";
                                                                        }
                                                                    }

                                                         print "</div>";
                                                         $boolCheck = 0;
                                                     }
                                                }
                                             }
                                        ?>
                                        
					<!--=========-->
					<!-- Dialogs -->
					<!--=========-->
					
					<div class="editing_story" id="edit_dialog" title="Edit user story">
                                            <p class="alert_string">This story title already exists!</p>
                                            <!-- Ce ni obvestila se doda razred hidden: class="alert_string hidden" -->

                                            <form class="dialog_form" method="post" action="./php/editStory.php">
                                                <!--<?php $story_id = 13; ?>
                                                <input type="hidden" name="story_id" id="story_id_unq" value=<?= $story_id ?> />    -->                                       
                                                <input type="hidden" name="usr_id_transfer" id="usr_id_transfer" value="<?= $usr_id ?>" />
                                                <input type="text" name="title" placeholder="title" id="title" />
                                                <textarea name="content" placeholder="content..." id="content"></textarea>
                                                <textarea name="tests" placeholder="acceptance tests..." id="tests"></textarea>
                                                <div class="styled_select">
                                                        <select id="priority" name="prior">
                                                                <option value="" disabled selected>priority</option>
                                                                <option value="1">must have</option>
                                                                <option value="2">should have</option>
                                                                <option value="3">could have</option>
                                                                <option value="4">won't have this time</option>
                                                        </select>
                                                </div>
                                                <p class="alert_string" id="bval">Value must be between 1 and 10!</p>
                                                <input type="text" name="value" placeholder="business value (1-10)" id="value" /><br/>

                                            </form>
					</div>
					
					<div id="delete_dialog" title="Delete user story">
						<p>Are you sure you want to delete this user story?</p>
					</div>
                                        
                                        <div id="delete_sprint_dialog" title="Delete sprint">
						<p>Are you sure you want to delete this sprint?</p>
					</div>
					
					<div id="notes_dialog" title="Edit notes">
						<form class="dialog_form">
							<textarea name="notes" placeholder="notes..." id="notes"></textarea>
						</form>
					</div>
					
					<div id='poker_dialog' title="Planning Poker">
                                            <div id="table">
                                                <img src="./dsg/loading.gif" alt="Loading...">
                                            </div>
                                            <div id="controls">
                                            </div>
						
						<!--<input id='poker_time_estimate' type='text' name='poker_time_estimate' placeholder='your estimate'/>
						<button id='poker_time_estimate_submit' type='submit'>submit</button>-->
					</div>
					
					<!--=============-->
					<!-- All stories -->
					<!--=============-->										
                                        
                                        <?php 
                                            $queryAll = "SELECT * FROM story WHERE story_finished < 1 and story_sprint < 1 and project_id = '$curr_proj'" ; // WHERE project_id = ena_spremenljivka
                                            $queryAllResult = executeQuery($queryAll);
                                            
                                            if (mysql_num_rows($queryAllResult) != 0){
                                                
                                                echo "<h3>All user stories</h3>";
                                            
                                                while ($row = mysql_fetch_array($queryAllResult)) {
                                                    $story_id       = $row["story_id"];
                                                    $story_title    = $row["story_title"];
                                                    $story_text     = $row["story_text"];
                                                    $story_test     = nl2br($row["story_test"]);
                                                    $story_value    = $row["story_value"];    
                                                    $story_time     = $row["story_time"];
                                                    $story_priority = $row["story_priority"];
                                                    $story_notes    = $row["story_notes"];

                                                    $prior = "priority not set";
                                                    if ($story_priority == 1)
                                                        $prior = "must have";
                                                    else if ($story_priority == 2)
                                                        $prior = "should have";
                                                    else if ($story_priority == 3)
                                                        $prior = "could have";
                                                    else if ($story_priority == 4)
                                                        $prior = "won't have this time";

                                                    if (!isset($story_time))
                                                        $story_time = $notSet;
                                                    else
                                                        $story_time = strval($story_time)." pt";

                                                    print "<div class=\"story\">
                                                                <input type=\"hidden\" name=\"story_id\" value=\"$story_id \" />
																<input type=\"hidden\" name=\"sprint_id\" value=\"$sprintInProgress \" />
                                                                <div class=\"header\">
                                                                    <h5>$story_title</h5><br/>";

                                                    if ($usr_id == $projectMaster) {
                                                                echo "<span class=\"values all_stories\"><span class=\"priority\">$prior</span> | business value: <span class=\"value\">$story_value</span> | time estimate:"; 
                                                                //if($projectMaster == $usr_id){ 
                                                              	echo "<input class=\"time_estimate\" type=\"text\" name=\"time\" value=\"$story_time\"/>";
                                                                echo "</span><a href=\"#\" class=\"delete_story\">delete</a> | <a href=\"#\" class=\"edit_story\">edit</a> | <a href=\"#\" class=\"notes_story\">notes</a> | <a href=\"#\" class=\"poker_story\">poker</a>";
                                                              //}
                                                              //echo "</span><a href=\"#\" class=\"delete_story\">delete</a> | <a href=\"#\" class=\"edit_story\">edit</a> | <a href=\"#\" class=\"notes_story\">notes</a> | <a href=\"#\" class=\"poker_story\">poker</a>";
                                                    }else if($usr_id == $productOwner){
                                                                echo "<span class=\"values all_stories\"><span class=\"priority\">$prior</span> | business value: <span class=\"value\">$story_value</span> | time estimate: $story_time</span>"; 
                                                                //echo "<input class=\"time_estimate\" type=\"text\" name=\"time\" value=\"$story_time\"/>";
                                                                echo "<a href=\"#\" class=\"delete_story\">delete</a> | <a href=\"#\" class=\"edit_story\">edit</a> | <a href=\"#\" class=\"notes_story\">notes</a>";
                                                    }else{

                                                              echo "<span class=\"values all_stories\"><span class=\"priority\">$prior</span> | business value: <span class=\"value\">$story_value</span> | time estimate: $story_time</span>";
                                                              echo "<a href=\"#\" class=\"notes_story\">notes</a>" .
                                                              		"<input type=\"hidden\" name=\"story_id\" value=\"$story_id \" id=\"id2\"/> ".
                                                              		" | <a href=\"#\" class=\"poker_story\">poker</a>";
                                                    }
                                                         print "</div>";
                                                                
                                                                    print "<p>$story_text</p>";
                                                                    if ($story_text != "")
                                                                        print "--";

                                                                print "<p class=\"test_list\">$story_test</p>";
                                                                if ($story_notes != "")
                                                                    print "--
                                                                    <p>$story_notes</p>";
                                                    
                                                    if ( ($projectMaster == $usr_id) )       
                                                          print "<div class=\"add_to_sprint\">
                                                                    <button type=\"button\" class=\"add_to_sprint_button\">add to sprint</button>
                                                                </div>";

                                                     echo "</div>";
                                                 } 
                                             }
                                        ?>	
				</div>
				
				<!--==================-->
				<!-- Finished stories -->
				<!--==================-->
				
				<div id="finished_stories">
                                    
                                    <?php 
                                    
                                            $queryFinished = "SELECT * FROM story WHERE story_finished = 1 and project_id = '$curr_proj'" ;
                                            $queryFinishedResult = executeQuery($queryFinished);

                                            if(mysql_num_rows($queryFinishedResult) == 0){
                                               print "<div class=\"story no_stories\">
                                                           <p>No finished stories</p>
                                                      </div>";
                                            }else{
                                                echo "<br/>";
                                                while ($row = mysql_fetch_array($queryFinishedResult)) {
                                                    $story_id       = $row["story_id"];
                                                    $story_title    = $row["story_title"];
                                                    $story_text     = nl2br($row["story_text"]);
                                                    $story_test     = nl2br($row["story_test"]);
                                                    $story_value    = $row["story_value"];    
                                                    $story_priority = $row["story_priority"];
                                                    $story_notes    = $row["story_notes"];

                                                    $prior = "priority not set";
                                                    if ($story_priority == 1)
                                                        $prior = "must have";
                                                    else if ($story_priority == 2)
                                                        $prior = "should have";
                                                    else if ($story_priority == 3)
                                                        $prior = "could have";
                                                    else if ($story_priority == 4)
                                                        $prior = "won't have this time";

                                                    print "<div class=\"story\">
                                                                <input type=\"hidden\" name=\"story_id\" value=\" $story_id \" />
                                                                <div class=\"header\">
                                                                    <span class=\"values\">$prior | business value: $story_value</span>
                                                                    <h5>$story_title</h5>
                                                                </div>";
                                                                if ($story_text != "")
                                                                print "<p>$story_text</p>
                                                                    --";
                                                                print "<p class=\"test_list\">$story_test</p>";
                                                                if ($story_notes != "")
                                                                        print "--
                                                                        <p>$story_notes</p>
                                                                        <!--<p>To so možni komentarji...</p>-->";   

                                                           print "</div>";
                                                 }
                                            }
                                    ?>   
                                    
				</div>
				
				<!--=============-->
				<!-- Add story -->
				<!--=============-->
				
				<div id="new_story" class="bracket">
                                        <p id="story_exists" class="alert_string hidden">
                                            This story title already exists!</p>
                                        <p id="add_story_success" class="alert_string hidden" style="color:#00ff00;">
                                            Story has been added successfully!</p>
                                        <p id="add_story_missing" class="alert_string hidden">
                                            Story title is missing!</p>
					<!-- Ce ni obvestila se doda razred hidden: class="alert_string hidden" -->
                                                           
					<form id="add_story_form" method="post">
                                                <input type="hidden" name="usr_id" value=<?=$usr_id?> />
						<input type="text" id="add_title" name="title" placeholder="title" required="required" /><br/>
						<textarea name="content" id="add_content" placeholder="content..." required="required"></textarea>
						<textarea name="tests" id="add_tests" placeholder="acceptance tests..." required="required"></textarea>
						<div class="styled_select">
							<select name="prior" id="add_priority">
								<option id="add_prior_zero" value="0" disabled selected>priority</option>
								<option value="1">must have</option>
								<option value="2">should have</option>
								<option value="3">could have</option>
								<option value="4">won't have this time</option>
							</select>
						</div>
                                                <p class="alert_string hidden" id="bval_new">Value must be between 1 and 10!</p>
						<input type="text" id="add_value" name="value" placeholder="business value (1-10)" required="required" /><br/>
						<input id="add_story_submit" type="submit" name="submit" value="add" formaction="./php/addStory.php" />
					</form>
				</div>
				
                                <!--================-->
				<!-- Manage sprints -->
				<!--================-->
				
				<div id="manage_sprints" class="bracket">
					<!-- <p class="alert_string">Obvestilo</p> -->
					
					<h3>Sprints for current project</h3>
					<hr />
					<?php
					$querySprint = "SELECT * FROM sprint WHERE project_id='$curr_proj';";
					$querySprintResult = executeQuery($querySprint);
					while ($row = mysql_fetch_array($querySprintResult)) {
						$sprint_id = 		$row['sprint_id'];
						$start_date = 		$row['start_date'];
						$finish_date = 		$row['finish_date'];
						$velocity = 		$row['velocity'];
						$sprint_number = 	$row['sprint_number'];
						
						$today = date("Y-m-d");
						$today = strtotime($today);	
						
						$start_date_compare = strtotime($start_date);
						$finish_date_compare = strtotime($finish_date);
						?>
					<div class="project">
						<input type="hidden" name="sprint_id" value="<?=$sprint_id?>" />
						<div class="right2">|&nbsp;
						<?php if($today > $finish_date_compare) { 
									echo "FINISHED"; ?> &nbsp;•&nbsp;velocity: <?=$velocity?> pts</div>
									<div class="left2"><h4>Sprint <?=$sprint_number?></h4>, <?php echo date('d.m.Y', strtotime($start_date))?> - <?php echo date('d.m.Y', strtotime($finish_date))?></div>
						<?php } else if ($today >= $start_date_compare && $today <= $finish_date_compare ) { 
							   		echo "<h4>IN PROGRESS</h4>"; ?> &nbsp;•&nbsp;velocity: <input class="velocity" type="text" name="velocity" value="<?=$velocity?>"/> pts</div>
							   		<div class="left2"><h4>Sprint <?=$sprint_number?></h4>, <?php echo date('d.m.Y', strtotime($start_date))?> - <?php echo date('d.m.Y', strtotime($finish_date))?></div>
						<?php }	else {  
							  		echo "<a href=\"#\" class=\"delete_sprint\">delete</a>"; ?> &nbsp;•&nbsp;velocity: <input class="velocity" type="text" name="velocity" value="<?=$velocity?>"/> pts</div>
							  		<div class="left2"><h4>Sprint <?=$sprint_number?></h4>, <?php echo date('d.m.Y', strtotime($start_date))?> - <?php echo date('d.m.Y', strtotime($finish_date))?></div>
									<div class="sprint_deleting">
										<button type="button" class="sprint_delete">delete</button>
										<button type="button" class="right_button">cancel</button>
									</div>
						<?php } ?>		
					</div>
					<?php
					}
					?>
					
					<!--<div class="project">
						<input type="hidden" name="sprint_id" value="1" />
						<div class="right2">|&nbsp;FINISHED&nbsp;•&nbsp;velocity: 28 pts</div>
						<div class="left2"><h4>Sprint 1</h4>, 18.03.2013 - 14.04.2013</div>
					</div>
					
					<div class="project">
						<input type="hidden" name="sprint_id" value="2" />
						<div class="right2">|&nbsp;<h4>IN PROGRESS</h4>&nbsp;&nbsp;•&nbsp;velocity: <input class="velocity" type="text" name="velocity" value="28"/> pts</div>
						<div class="left2"><h4>Sprint 2</h4>, 18.03.2013 - 14.04.2013</div>
					</div>
					
					<div class="project">
						<input type="hidden" name="sprint_id" value="3" />
						<div class="right2">|&nbsp;<a href="#" class="delete_sprint">delete</a>&nbsp;•&nbsp;velocity: <input class="velocity" type="text" name="velocity" value="28"/> pts</div>
						<div class="left2"><h4>Sprint 3</h4>, 18.03.2013 - 14.04.2013</div>
					</div>
					<div class="sprint_deleting">
						<button type="button" class="sprint_delete">delete</button>
						<button type="button" class="right_button">cancel</button>
					</div>
					
					<div class="project">
						<input type="hidden" name="sprint_id" value="4" />
						<div class="right2">|&nbsp;<a href="#" class="delete_sprint">delete</a>&nbsp;•&nbsp;velocity: <input class="velocity" type="text" name="velocity" value="28"/> pts</div>
						<div class="left2"><h4>Sprint 4</h4>, 18.03.2013 - 14.04.2013</div>
					</div>
					<div class="sprint_deleting">
						<button type="button" class="sprint_delete">delete</button>
						<button type="button" class="right_button">cancel</button>
					</div>
					-->
					<br />
					<h3>New sprint</h3>
					<hr />
					<p id="error_msg_sprint" class="alert_string" ></p>
					<form id="add_sprint_form" method="post" >
						<input type="hidden" name="curr_proj_id" value="<?=$curr_proj?>" />
						<input type="date" name="start_date" placeholder="Start date" required="required" /><br/>
						<input type="date" name="finish_date" placeholder="Finish date" required="required" /><br/>
						<input type="number" name="velocity" placeholder="Velocity (pts)" required="required" /><br/>
						<input id="add_sprint_submit" type="submit" name="submit" value="add"  />
						
					</form>
					
				</div>	
			</div>
			
                        <?php } ?>
		</section>
		
	</body>
</html>